package com.etc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.etc.dao.UserMapper;
import com.etc.entity.User;
import com.etc.service.UserService;

import cn.hutool.crypto.SecureUtil;

/**
 * 
 * @ClassName: UserServiceImpl
 * @Description: UserServiceImpl
 * @author knowno
 * @date 2022年4月7日 上午10:57:41
 *
 */
@Service
public class UserServiceImpl implements UserService {

	// 注入mapper
	@Autowired
	private UserMapper mapper;

	@Override
	public User login(User user) {
		String pass = SecureUtil.md5(user.getPassword());
		user.setPassword(pass);
		User u = mapper.selectByCons(user);
		return u;
	}

}
